package com.androsz.ramdroidx;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class SplashActivity extends Activity {
	private final OnClickListener onDonateClick = new OnClickListener() {
		@Override
		public void onClick(final View v) {

			final Uri marketUri = Uri.parse("market://details?id=com.androsz.ramdroiddonate");
			final Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
			startActivity(marketIntent);
		}
	};

	private final OnClickListener onElectricSleepClick = new OnClickListener() {
		@Override
		public void onClick(final View v) {
			final Uri marketUri = Uri.parse("market://details?id=com.androsz.electricsleepbeta");
			final Intent marketIntent = new Intent(Intent.ACTION_VIEW, marketUri);
			startActivity(marketIntent);
		}
	};

	@Override
	public void onCreate(final Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_splash);

		final Button buttonDonate = (Button) findViewById(R.id.buttonDonate);
		buttonDonate.setOnClickListener(onDonateClick);

		final Button buttonElectricSleep = (Button) findViewById(R.id.buttonElectricSleep);
		buttonElectricSleep.setOnClickListener(onElectricSleepClick);
	}
}
